<%-- 
    Document   : exam-remove-action
    Created on : Feb 19, 2012, 2:49:29 PM
    Author     : PhucAn
--%>

<%@page import="dao.ExamDAO"%>
<%@page import="dao.QuestionSetDAO"%>
<%
    int id = Integer.parseInt(request.getParameter("id"));
    boolean deleteQuestion = Boolean.parseBoolean(request.getParameter("delete-question"));
    QuestionSetDAO daoQS = new QuestionSetDAO();
    ExamDAO daoExam = new ExamDAO();
    int eff = 0;
    if (deleteQuestion) {
        daoQS.delete(id, true);
    } else {
        daoQS.delete(id, false);
    }
    eff = daoExam.delete(id);
    if (eff > 0) {
        out.println(1);
    } else {
        out.println(0);
    }
%>